// 泛型类
// 与泛型接口类似，泛型也可以用于类的类型定义中
class GenericNumber<T = string> {
  zeroValue: T
  add: (x: T, y: T) => T
}
let myGenericNumber = new GenericNumber<number>()
myGenericNumber.zeroValue = 0
myGenericNumber.add = function (x, y) {
  return x + y
}